package org.ben.xintoucloud.javase.collection;

import java.util.ArrayList;

/**
 * @Author: Ben
 * @Date: 2019/7/11 16:51
 */
public class List {
    public static void main(String[] args) {
        ArrayList<String> arrayList=new ArrayList();
        for (int i = 1; i <=9 ; i++) {
            for (int j = 1; j <=i ; j++) {
               arrayList.add(String.format("%s*%s=%s ",i,j,i*j));
//                System.out.print(i+"*"+j+"="+i*j+" ");
            }
        }

            int a=0;
        for (int i = 1; i <=9 ; i++) {
            for (int j = 1; j <=i ; j++) {
                System.out.print(arrayList.get(a));
//                System.out.print(i+"*"+j+"="+i*j+" ");
            a++;
            }
            System.out.println();
        }

//        Iterator iterator=arrayList.iterator();
//        while(iterator.hasNext()){
//            System.out.print(iterator.next());
//        }
    }
}
